<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>智能营养管理系统</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
</head>
<body>
    <div class="container mt-5">
        <!-- 欢迎横幅 -->
        <div class="bg-primary text-white p-5 rounded text-center mb-4">
            <h1 class="display-4 fw-bold mb-3">
                <i class="fas fa-leaf me-3"></i>智能营养管理系统
            </h1>
            <p class="lead">科学饮食，健康生活，让AI为您的营养保驾护航</p>
        </div>

        <!-- 用户状态显示 -->
        <div class="row justify-content-center">
            <div class="col-md-8">
                <div class="card">
                    <div class="card-body text-center">
                        <div th:if="${user != null}">
                            <h3>欢迎回来，<span th:text="${user.username}">用户</span>！</h3>
                            <p class="text-muted">您已成功登录系统</p>
                            <div class="d-flex justify-content-center gap-3 mt-4">
                                <a href="/meals" class="btn btn-primary">
                                    <i class="fas fa-utensils me-2"></i>开始点餐
                                </a>
                                <a href="/nutrition/dashboard" class="btn btn-success">
                                    <i class="fas fa-chart-line me-2"></i>营养仪表盘
                                </a>
                                <a href="/alerts" class="btn btn-warning">
                                    <i class="fas fa-bell me-2"></i>预警中心
                                </a>
                            </div>
                        </div>
                        
                        <div th:if="${user == null}">
                            <h3>欢迎使用智能营养管理系统</h3>
                            <p class="text-muted">请登录或注册以开始使用</p>
                            <div class="d-flex justify-content-center gap-3 mt-4">
                                <a href="/login" class="btn btn-primary">
                                    <i class="fas fa-sign-in-alt me-2"></i>登录
                                </a>
                                <a href="/register" class="btn btn-outline-primary">
                                    <i class="fas fa-user-plus me-2"></i>注册
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- 功能介绍 -->
        <div class="row mt-5">
            <div class="col-md-4 mb-3">
                <div class="card h-100 text-center">
                    <div class="card-body">
                        <i class="fas fa-robot fa-3x text-primary mb-3"></i>
                        <h5>AI智能推荐</h5>
                        <p class="text-muted">基于您的饮食偏好和营养需求，AI算法为您推荐最适合的菜品搭配</p>
                    </div>
                </div>
            </div>
            <div class="col-md-4 mb-3">
                <div class="card h-100 text-center">
                    <div class="card-body">
                        <i class="fas fa-chart-pie fa-3x text-success mb-3"></i>
                        <h5>营养分析</h5>
                        <p class="text-muted">详细记录每日营养摄入，实时分析营养结构，科学调整饮食习惯</p>
                    </div>
                </div>
            </div>
            <div class="col-md-4 mb-3">
                <div class="card h-100 text-center">
                    <div class="card-body">
                        <i class="fas fa-bell fa-3x text-warning mb-3"></i>
                        <h5>智能预警</h5>
                        <p class="text-muted">营养摄入异常时及时预警，提醒您调整饮食，避免营养不良</p>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
